/* 
 * File:   Camera.cpp
 * Author: brady
 * 
 * Created on June 23, 2011, 5:51 PM
 */

#include <core/Camera.h>
#include <pthread.h>

Camera::Camera() {
    origin = Vector3D(0,0,0);
    gaze = Vector3D(0,0,1);
    focalLength = 2;
    planeWidth = 1;
    buildBasis();
    pthread_mutex_init(&cameraLock, NULL);
}

Camera::Camera(Vector3D origin, Vector3D gaze){
    this->origin = origin;
    this->gaze = gaze;
    focalLength = 2;
    planeWidth = 1;
    buildBasis();
    pthread_mutex_init(&cameraLock, NULL);
}

Camera::Camera(const Camera& orig) {
}

Camera::~Camera() {
}

void Camera::buildBasis(){
    Vector3D UP = Vector3D(0.0,1.0,0.0);
    w = gaze * -1.0;
    u = UP.cross(w).normalize();
    v = w.cross(u).normalize();
}
